package co.yixiang.modules.system.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
* @author zf
* @date 2021-10-11
*/
@Data
@Accessors(chain = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("partner_image")
public class PartnerImage implements Serializable {

    @TableId
    private Integer id;


    /** 模版名称 */
    private String name;


    /** 图片地址 */
    private String imgUrl;


    /** 文案一 */
    private String clerkOne;


    /** 文案二 */
    private String clerkTwo;


    /** 创建时间 */
    @TableField(fill= FieldFill.INSERT)
    private LocalDateTime createTime;


    public void copy(PartnerImage source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
